﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Content;

namespace Bombardiman
{
    class Map
    {
        private List<Wall> listOfWalls = new List<Wall>();
        private int[,] map = new int[6, 9]{
                                    {2,2,2,2,2,2,2,2,2},
                                    {2,0,0,0,1,1,0,1,2},
                                    {2,0,1,0,1,0,0,0,2},
                                    {2,0,1,0,1,0,1,0,2},
                                    {2,1,1,1,0,0,1,0,2},
                                    {2,2,2,2,2,2,2,2,2}
                                    };

        public Map()
        {
            initializeMap();
        }

        private void initializeMap()
        {
            for (int i = 0; i < 6; i++)
            {
                for (int j = 0; j < 9; j++)
                {
                    if (map[i, j] == 1) // destructable wall
                    {
                        Wall wall = new Wall(new Vector2(j * 100, i * 100), true);
                        wall.setDestroyable(true);
                        listOfWalls.Add(wall);
                    }
                    if (map[i, j] == 2) //non destructable wall, 
                    {
                        Wall wall = new Wall(new Vector2(j * 100, i * 100), false);
                        wall.setDestroyable(false);
                        listOfWalls.Add(wall);
                    }
                }
            }
        }

        public List<Wall> getWallList()
        {
            return listOfWalls;
        }

    }
}
